package cn.meye11.crm.domain.entity;

import cn.meye11.crm.domain.model.RechargeRecord;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.annotation.LogicDelete;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 充值记录表(RechargeRecord)类
 *
 * @author makejava
 * @since 2023-11-18 19:20:48
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = RechargeRecordEntity.Table)
public class RechargeRecordEntity implements Serializable {

    public static final String Table = "t_recharge_record";
    private static final long serialVersionUID = 356297016375195791L;

    public RechargeRecordEntity(RechargeRecord model) {
        BeanUtils.copyProperties(model, this);
    }

    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(insertable = false)
    private Long id;
    /* 会员ID */
    private Long memberId;
    /* 会员名称 */
    private String memberName;
    /* 操作人ID */
    private Long userId;
    /* 充值金额 */
    private Double amount;
    /* 赠送金额 */
    private Double giftAmount;
    /* 充值方式 */
    private String rechargeType;
    /* 充值时间 */
    private LocalDateTime rechargeTime;
    /* 操作人姓名 */
    private String operators;
    /* 标签 */
    private String label;
    /* 是否删除 */
    @LogicDelete
    private Integer del;
    /* 最后修改时间 */
    private LocalDateTime last;
    /* 创建时间 */
    private LocalDateTime time;
    /* 创建人 */
    private String createdBy;
    /* 最后修改人 */
    private String modifiedBy;
    /* 版本 */
//    @Version
    private Integer version;

}
